﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Kcadastro.classes;

namespace Kcadastro.adm
{
    public partial class billing_relat : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["i"] != null)
                {
                    if (Request.QueryString["i"].ToString() != "")
                    {
                        tbi_bill.Text = Request.QueryString["i"].ToString();
                        carregar();
                    }
                }
            }
        }


        private void carregar()
        { 
            bill bl = new bill();
            BillRelat br = bl.billDados(Convert.ToInt64(tbi_bill.Text));
            lt_empresa.Text = br.EMP;
            lt_periodo.Text = br.DTFECH.ToString("MM/yyyy");
            lt_valor.Text = string.Format("{0:C}", br.VALOR);

            gv_lista.DataSource = bl.listaDeOSs(Convert.ToInt64(tbi_bill.Text));
            gv_lista.DataBind();
        }
    }
}